Skip to content

Conversation

@leigaol
Copy link
Contributor

@leigaol leigaol commented Jul 14, 2025

Problem

Previous the pagination API call was blocking and it does not render until all pagination API calls are done.
Without a force refresh of the inline ghost text, paginated response will not be rendered.

Solution

  1. Keep doing paginated API call in the background.
  2. Refresh the ghost text of inline completion when user press Left or Right key to add paginated responses by calling VS Code native commands.

Note that we can do such refresh below whenever the pagination session finish but that will result in inline completion flickering, hence it is better to do it on demand when Left or Right is pressed.

await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
 await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger')

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@leigaol leigaol requested a review from a team as a code owner July 14, 2025 20:28
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger')
this._refreshedSessions.add(this.activeSession.sessionId)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leigaol so this will only be invoked when cx click ">" or "<" correct? So the suggestions in the pagination response will only be rendered once they press either keyboard shortcut right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Do not render paginated response if there is no Left Right key input.

@Will-ShaoHua Will-ShaoHua self-requested a review July 14, 2025 22:06
@leigaol leigaol merged commit b74f9e1 into aws:master Jul 14, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants